<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/dute_favicon_32x32.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/dute_favicon_16x16.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">
  <link rel="manifest" href="/images/manifest.json">
  <meta name="msapplication-config" content="/images/browserconfig.xml">
  <meta http-equiv="Cache-Control" content="no-transform">
  <meta http-equiv="Cache-Control" content="no-siteapp">
  <meta name="google-site-verification" content="mpI5dkydstZXl6UcDCppqktXK0bbvqdZ6LkZ3KNk4Iw">
  <meta name="baidu-site-verification" content="code-a1LksZX2Ds">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">
  <link rel="stylesheet" href="//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"whitestore.top","root":"/","scheme":"Gemini","version":"7.8.0","exturl":true,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":true,"scrollpercent":true},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":true,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="我修复了百度编辑器上的一个BUG">
<meta property="og:type" content="article">
<meta property="og:title" content="终于把百度编辑器的一个坑填了">
<meta property="og:url" content="https://whitestore.top/2020/10/13/note33/index.html">
<meta property="og:site_name" content="爱看书的阿东">
<meta property="og:description" content="我修复了百度编辑器上的一个BUG">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://gitee.com/lazyTimes/imageReposity/raw/master/jiuhe/20201012203818.png?ynotemdtimestamp=1602599291444">
<meta property="article:published_time" content="2020-10-13T15:04:48.000Z">
<meta property="article:modified_time" content="2023-07-16T06:28:09.273Z">
<meta property="article:author" content="阿东">
<meta property="article:tag" content="百度编辑器">
<meta property="article:tag" content="前端">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://gitee.com/lazyTimes/imageReposity/raw/master/jiuhe/20201012203818.png?ynotemdtimestamp=1602599291444">

<link rel="canonical" href="https://whitestore.top/2020/10/13/note33/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>终于把百度编辑器的一个坑填了 | 爱看书的阿东</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

<link rel="alternate" href="/atom.xml" title="爱看书的阿东" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">爱看书的阿东</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">赐他一块白色石头，石头上写着新名</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
        <li class="menu-item menu-item-sitemap">

    <a href="/sitemap.xml" rel="section"><i class="fa fa-fw fa-sitemap"></i>站点地图</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    

  <span class="exturl github-corner" data-url="aHR0cHM6Ly9naXRodWIuY29tL2xhenlUaW1lcw==" title="Follow me on GitHub" aria-label="Follow me on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></span>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://whitestore.top/2020/10/13/note33/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="阿东">
      <meta itemprop="description" content="随遇而安">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="爱看书的阿东">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          终于把百度编辑器的一个坑填了
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2020-10-13 23:04:48" itemprop="dateCreated datePublished" datetime="2020-10-13T23:04:48+08:00">2020-10-13</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2023-07-16 14:28:09" itemprop="dateModified" datetime="2023-07-16T14:28:09+08:00">2023-07-16</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/frontend/" itemprop="url" rel="index"><span itemprop="name">前端</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2020/10/13/note33/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2020/10/13/note33/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="fa fa-file-word-o"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>3.6k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="fa fa-clock-o"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>3 分钟</span>
            </span>
            <div class="post-description">我修复了百度编辑器上的一个BUG</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h1 id="前言："><a href="#前言：" class="headerlink" title="前言："></a>前言：</h1><p>上文说道，我被百度编辑器上了套，今天，说下我的个人进展，因为我把截图粘贴的功能兼容到IE了，算是给自己的鼓励。</p>
<a id="more"></a>

<h1 id="开始"><a href="#开始" class="headerlink" title="开始"></a>开始</h1><p>其实还挺简单的，内容如下：</p>
<p>在<code>ueditor.all.js</code>当中，输入<code>domUtils.on(me.body, &#39;paste drop&#39;, function(e){</code>可以看到类似粘贴板处理的代码</p>
<p>我对里面的内容进行了如下的处理</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br></pre></td><td class="code"><pre><span class="line">if(isIE())&#123;</span><br><span class="line">    var text &#x3D; window.clipboardData.getData(&#39;Text&#39;);</span><br><span class="line">    if(text &#x3D;&#x3D; null)&#123;</span><br><span class="line">        var items&#x3D;clipboardData.files;</span><br><span class="line">        for (var i &#x3D; 0, len &#x3D; items.length; i &lt; len; i++) &#123;</span><br><span class="line">            var item &#x3D; items[i];</span><br><span class="line">            if ( item.type.indexOf(&#39;image&#x2F;&#39;) !&#x3D;&#x3D; -1 ) &#123;</span><br><span class="line">                &#x2F;&#x2F;上传到服务器</span><br><span class="line">                sendAndInsertFile(item,me); </span><br><span class="line">                &#x2F;&#x2F;阻止默认事件, 避免重复添加;</span><br><span class="line">                e.preventDefault();</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;else&#123;</span><br><span class="line">    var hasImg &#x3D; false,</span><br><span class="line">        items;</span><br><span class="line">    &#x2F;&#x2F;获取粘贴板文件列表或者拖放文件列表</span><br><span class="line">    items &#x3D; e.type &#x3D;&#x3D; &#39;paste&#39; ? getPasteImage(e):getDropImage(e);</span><br><span class="line">    if(items)&#123;</span><br><span class="line">        var len &#x3D; items.length,</span><br><span class="line">            file;</span><br><span class="line">        while (len--)&#123;</span><br><span class="line">            file &#x3D; items[len];</span><br><span class="line">            if(file.getAsFile) file &#x3D; file.getAsFile();</span><br><span class="line">            if(file &amp;&amp; file.size &gt; 0) &#123;</span><br><span class="line">                sendAndInsertFile(file, me);</span><br><span class="line">                hasImg &#x3D; true;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        hasImg &amp;&amp; e.preventDefault();</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<ol>
<li>判断是否为IE，是IE特殊处理</li>
<li>使用IE特定的获取粘贴板的内容</li>
<li>获取到文件内容，调用百度编辑器的上传方法，将粘贴板的内容上传到服务器。</li>
</ol>
<h2 id="关于word粘贴内容到富文本编辑框"><a href="#关于word粘贴内容到富文本编辑框" class="headerlink" title="关于word粘贴内容到富文本编辑框"></a>关于word粘贴内容到富文本编辑框</h2><p>今天大部分时间都在纠结这玩意，后续考虑自己二次开发插件做二次处理，明天果断和前端配合试下效果。</p>
<p>今天还是了解到不少内容的：</p>
<ol>
<li>了解了一下Base64 的内容</li>
<li>js如何处理 copy 、paste 时间，以及通过事件监听处理<code>copy</code>、<code>paste</code></li>
<li>IE和谷歌的对于剪贴板内容的不同处理方式</li>
<li>了解了一下插件的二次开发</li>
</ol>
<h1 id="如何给百度编辑器进行插件的二次开发"><a href="#如何给百度编辑器进行插件的二次开发" class="headerlink" title="如何给百度编辑器进行插件的二次开发"></a>如何给百度编辑器进行插件的二次开发</h1><p><span class="exturl" data-url="aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dpaWNtcy9hcnRpY2xlL2RldGFpbHMvNDY0MTI1ODU=" title="https://blog.csdn.net/wiicms/article/details/46412585">https://blog.csdn.net/wiicms/article/details/46412585<i class="fa fa-external-link"></i></span> 百度ueditor编辑器插件开发之对话框-移动微模板插件</p>
<p>直接复制里面的内容</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br></pre></td><td class="code"><pre><span class="line">&#x2F;&#x2F; TODO 为百度编辑器开发一个新插件</span><br><span class="line">    UE.registerUI(&#39;dialog&#39;,function(editor,uiName)&#123;</span><br><span class="line"></span><br><span class="line">    &#x2F;&#x2F;创建dialog</span><br><span class="line">    var dialog &#x3D; new UE.ui.Dialog(&#123;</span><br><span class="line">        &#x2F;&#x2F;指定弹出层中页面的路径，这里只能支持页面,因为跟addCustomizeDialog.js相同目录，所以无需加路径</span><br><span class="line">        iframeUrl:editor.ui.UEDITOR_HOME_URL+&quot;p&#x2F;uet.html&quot;,</span><br><span class="line">        &#x2F;&#x2F;需要指定当前的编辑器实例</span><br><span class="line">        editor:ue,</span><br><span class="line">        &#x2F;&#x2F;指定dialog的名字</span><br><span class="line">        name:uiName,</span><br><span class="line">        &#x2F;&#x2F;dialog的标题</span><br><span class="line">        title:&quot;微信模板&quot;,</span><br><span class="line">        &#x2F;&#x2F;指定dialog的外围样式</span><br><span class="line">        cssRules:&quot;width:540px;height:400px;&quot;,</span><br><span class="line">        &#x2F;&#x2F;如果给出了buttons就代表dialog有确定和取消</span><br><span class="line">        buttons:[</span><br><span class="line">            &#123;</span><br><span class="line">                className:&#39;edui-okbutton&#39;,</span><br><span class="line">                label:&#39;确定&#39;,</span><br><span class="line">                onclick:function () &#123;</span><br><span class="line">                    dialog.close(true);</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;,</span><br><span class="line">            &#123;</span><br><span class="line">                className:&#39;edui-cancelbutton&#39;,</span><br><span class="line">                label:&#39;取消&#39;,</span><br><span class="line">                onclick:function () &#123;</span><br><span class="line">                    dialog.close(false);</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">        ]&#125;);</span><br><span class="line"></span><br><span class="line">    &#x2F;&#x2F;参考addCustomizeButton.js</span><br><span class="line">        var btn &#x3D; new UE.ui.Button(&#123;</span><br><span class="line">            name:&#39;dialogbutton&#39; + uiName,</span><br><span class="line">            title:&#39;dialogbutton&#39; + uiName,</span><br><span class="line">            &#x2F;&#x2F;需要添加的额外样式，指定icon图标，这里默认使用一个重复的icon</span><br><span class="line">            cssRules :&#39;background-position: -500px 0;&#39;,</span><br><span class="line">            onclick:function () &#123;</span><br><span class="line">                &#x2F;&#x2F;渲染dialog</span><br><span class="line">                dialog.render();</span><br><span class="line">                dialog.open();</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;);</span><br><span class="line">        return btn;</span><br><span class="line">    &#125;&#x2F;*index 指定添加到工具栏上的那个位置，默认时追加到最后,editorId 指定这个UI是那个编辑器实例上的，默认是页面上所有的编辑器都会添加这个按钮*&#x2F;);</span><br><span class="line">    &#x2F;&#x2F;TODO 为百度编辑器开发一个新插件</span><br></pre></td></tr></table></figure>

<p><span class="exturl" data-url="aHR0cDovL2ZleC5iYWlkdS5jb20vdWVkaXRvci8jZGV2LWRldmVsb3Blcg==" title="http://fex.baidu.com/ueditor/#dev-developer">http://fex.baidu.com/ueditor/#dev-developer<i class="fa fa-external-link"></i></span> 官方文档解答如何开发二次插件</p>
<h1 id="最后："><a href="#最后：" class="headerlink" title="最后："></a>最后：</h1><p>工作之余随手写下，前端知识UP，回家继续学习去咯。</p>
<p>来，我们随手从QQ复制一个别人发的图片，贴到百度编辑器，好，内网地址又暴露了（卒）。。。。。</p>
<p><img src="https://gitee.com/lazyTimes/imageReposity/raw/master/jiuhe/20201012203818.png?ynotemdtimestamp=1602599291444" alt="img"></p>
<h1 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h1><p>使用开源插件读取word内容：<span class="exturl" data-url="aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2VpY2VibHVlL2FydGljbGUvZGV0YWlscy84OTUxOTI5Nw==" title="https://blog.csdn.net/eiceblue/article/details/89519297">https://blog.csdn.net/eiceblue/article/details/89519297<i class="fa fa-external-link"></i></span></p>
<p>java 使用POI操作word获取样式：<span class="exturl" data-url="aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQxMTI5ODExL2FydGljbGUvZGV0YWlscy8xMDI1NzA3MjY=" title="https://blog.csdn.net/qq_41129811/article/details/102570726">https://blog.csdn.net/qq_41129811/article/details/102570726<i class="fa fa-external-link"></i></span></p>
<blockquote>
<p>可以学习一下poi 是如何获取到样式和内容的</p>
</blockquote>
<p>js中使用Clipboard API获取剪贴板内容：<span class="exturl" data-url="aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2hhb2FpcWlhbi9hcnRpY2xlL2RldGFpbHMvMTAwOTI5MTQzP3V0bV9tZWRpdW09ZGlzdHJpYnV0ZS5wY19hZ2dwYWdlX3NlYXJjaF9yZXN1bHQubm9uZS10YXNrLWJsb2ctMmFsbGZpcnN0X3JhbmtfdjJ+cmFua192MjUtMS0xMDA5MjkxNDMubm9uZWNhc2UmYW1wO3V0bV90ZXJtPWll" title="https://blog.csdn.net/haoaiqian/article/details/100929143?utm_medium=distribute.pc_aggpage_search_result.none-task-blog-2allfirst_rank_v2~rank_v25-1-100929143.nonecase&amp;utm_term=ie">https://blog.csdn.net/haoaiqian/article/details/100929143?utm_medium=distribute.pc_aggpage_search_result.none-task-blog-2allfirst_rank_v2~rank_v25-1-100929143.nonecase&amp;utm_term=ie<i class="fa fa-external-link"></i></span></p>
<p>获取剪贴板数据：<span class="exturl" data-url="aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2l0ZXllXzQ4NjUvYXJ0aWNsZS9kZXRhaWxzLzgyMjAwOTg2" title="https://blog.csdn.net/iteye_4865/article/details/82200986">https://blog.csdn.net/iteye_4865/article/details/82200986<i class="fa fa-external-link"></i></span></p>
<p>js 文本框监听粘贴事件，获取粘贴板上的图片数据：<span class="exturl" data-url="aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2x1eWFuZ2JpbjAxL2FydGljbGUvZGV0YWlscy82OTUyNTc3Ng==" title="https://blog.csdn.net/luyangbin01/article/details/69525776">https://blog.csdn.net/luyangbin01/article/details/69525776<i class="fa fa-external-link"></i></span></p>
<p>js处理剪贴板的内容：<span class="exturl" data-url="aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzMxNDExMzg5L2FydGljbGUvZGV0YWlscy81MzAwNzY3NT91dG1fbWVkaXVtPWRpc3RyaWJ1dGUucGNfYWdncGFnZV9zZWFyY2hfcmVzdWx0Lm5vbmUtdGFzay1ibG9nLTJhbGxmaXJzdF9yYW5rX3YyfnJhbmtfdjI1LTMtNTMwMDc2NzUubm9uZWNhc2UmYW1wO3V0bV90ZXJtPWll" title="https://blog.csdn.net/qq_31411389/article/details/53007675?utm_medium=distribute.pc_aggpage_search_result.none-task-blog-2allfirst_rank_v2~rank_v25-3-53007675.nonecase&amp;utm_term=ie">https://blog.csdn.net/qq_31411389/article/details/53007675?utm_medium=distribute.pc_aggpage_search_result.none-task-blog-2allfirst_rank_v2~rank_v25-3-53007675.nonecase&amp;utm_term=ie<i class="fa fa-external-link"></i></span></p>
<p>富文本编辑器实现从word中复制图片(外挂)：<span class="exturl" data-url="aHR0cHM6Ly93d3cuaGVsbG9qYXZhLmNvbS9hLzkyMzU2Lmh0bWw=" title="https://www.hellojava.com/a/92356.html">https://www.hellojava.com/a/92356.html<i class="fa fa-external-link"></i></span></p>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/kity@2.0.4/dist/kity.min.js"></script><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/kityminder-core@1.4.50/dist/kityminder.core.min.js"></script><script defer="true" type="text/javascript" src="https://cdn.jsdelivr.net/npm/hexo-simple-mindmap@0.2.0/dist/mindmap.min.js"></script><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/hexo-simple-mindmap@0.2.0/dist/mindmap.min.css">
    </div>

    
    
    
        

<div>
<ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者： </strong>lazytime
  </li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    <a href="https://whitestore.top/2020/10/13/note33/" title="终于把百度编辑器的一个坑填了">https://whitestore.top/2020/10/13/note33/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <span class="exturl" data-url="aHR0cHM6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL2xpY2Vuc2VzL2J5LW5jLzQuMC96aC1DTg=="><i class="fa fa-fw fa-creative-commons"></i>BY-NC</span> 许可协议。转载请注明出处！
  </li>
</ul>
</div>


      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/%E5%89%8D%E7%AB%AF/" rel="tag"># 前端</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2020/10/11/note31/" rel="prev" title="一篇帖子解决window.open中使用jquery操作父元素的问题">
      <i class="fa fa-chevron-left"></i> 一篇帖子解决window.open中使用jquery操作父元素的问题
    </a></div>
      <div class="post-nav-item">
    <a href="/2020/10/13/note34/" rel="next" title="我还是输给了免费富文本编辑器">
      我还是输给了免费富文本编辑器 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#前言："><span class="nav-number">1.</span> <span class="nav-text">前言：</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#开始"><span class="nav-number">2.</span> <span class="nav-text">开始</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#关于word粘贴内容到富文本编辑框"><span class="nav-number">2.1.</span> <span class="nav-text">关于word粘贴内容到富文本编辑框</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#如何给百度编辑器进行插件的二次开发"><span class="nav-number">3.</span> <span class="nav-text">如何给百度编辑器进行插件的二次开发</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#最后："><span class="nav-number">4.</span> <span class="nav-text">最后：</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#参考资料"><span class="nav-number">5.</span> <span class="nav-text">参考资料</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">阿东</p>
  <div class="site-description" itemprop="description">随遇而安</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">239</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">36</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">37</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL2xhenlUaW1lcw==" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;lazyTimes"><i class="fa fa-fw fa-github"></i>GitHub</span>
      </span>
      <span class="links-of-author-item">
        <span class="exturl" data-url="bWFpbHRvOjEwOTc0ODM1MDhAcXEuY29t" title="E-Mail → mailto:1097483508@qq.com"><i class="fa fa-fw fa-envelope"></i>E-Mail</span>
      </span>
  </div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title">
      <i class="fa fa-fw fa-link"></i>
      友情链接
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <span class="exturl" data-url="aHR0cHM6Ly93d3cuNTJwb2ppZS5jbi9ob21lLnBocD9tb2Q9c3BhY2UmdWlkPTE0OTc3MTgmZG89dGhyZWFkJnZpZXc9bWUmZnJvbT1zcGFjZQ==" title="https:&#x2F;&#x2F;www.52pojie.cn&#x2F;home.php?mod&#x3D;space&amp;uid&#x3D;1497718&amp;do&#x3D;thread&amp;view&#x3D;me&amp;from&#x3D;space">吾爱破解</span>
        </li>
        <li class="links-of-blogroll-item">
          <span class="exturl" data-url="aHR0cHM6Ly9qdWVqaW4uaW0vdXNlci8yOTk5MTIzNDUyNjI2MzY2" title="https:&#x2F;&#x2F;juejin.im&#x2F;user&#x2F;2999123452626366">掘金</span>
        </li>
        <li class="links-of-blogroll-item">
          <span class="exturl" data-url="aHR0cHM6Ly9zZWdtZW50ZmF1bHQuY29tL3UvbGF6eXRpbWVz" title="https:&#x2F;&#x2F;segmentfault.com&#x2F;u&#x2F;lazytimes">思否</span>
        </li>
    </ul>
  </div>

      </div>

      <div class="wechat_OA">
        <span>欢迎关注我的公众号</span>
        <br>
          <!-- 这里添加你的二维码图片 -->
        <img src ="https://adong-picture.oss-cn-shenzhen.aliyuncs.com/adong/wechat_channel.jpg">
      </div>
        <div class="back-to-top motion-element">
          <i class="fa fa-arrow-up"></i>
          <span>0%</span>
        </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2023</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">阿东</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-area-chart"></i>
    </span>
      <span class="post-meta-item-text">站点总字数：</span>
    <span title="站点总字数">2m</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span class="post-meta-item-text">站点阅读时长 &asymp;</span>
    <span title="站点阅读时长">29:50</span>
</div>
  <div class="powered-by">由 <span class="exturl theme-link" data-url="aHR0cHM6Ly9oZXhvLmlv">Hexo</span> & <span class="exturl theme-link" data-url="aHR0cHM6Ly90aGVtZS1uZXh0Lm9yZw==">NexT.Gemini</span> 强力驱动
  </div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
  <script src="//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : false,
      notify     : true,
      appId      : 'qMUpEEvBgXaMDD1b0ftgi9xr-gzGzoHsz',
      appKey     : 'UCdfT4Rfih6MO6y8DI4fstf6',
      placeholder: "Just go go",
      avatar     : 'mm',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : false,
      lang       : 'zh-CN' || 'zh-cn',
      path       : location.pathname,
      recordIP   : false,
      serverURLs : ''
    });
  }, window.Valine);
});
</script>

</body>
</html>
